package java_learn.java_jinjie.Lambda;

/**
 * @Author: 李浩然
 * @Date: 2020/12/22 3:06 下午
 */
public class DemoTest {
    public static void main(String[] args) {
        Runnable run = new DemoRunnnable();
        Thread t = new Thread(run);
        t.start();

        //简化代码(匿名内部类)
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + "新的线程创建了");
            }
        }).start();

        //简化代码(Lambda)
        new Thread(() -> System.out.println(Thread.currentThread().getName() + "新的线程创建了"));
    }
}
